package com.wss.dao;

import com.wss.domain.VideoType;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 视频分类dao接口
 * @author Renexton
 */
@Repository
public interface VideoTypeDao {

    /**
     * 查询出所有分类信息
     * @return
     */
    @Select("select vt.*,headername from videotype as vt inner join typeheader as th on (vt.vth_id = th.id)")
    List<VideoType> findTypeAll();

    /**
     * 查询出根据typeheader划分的视频分类信息
     * @param vth_id
     * @return
     */
    @Select("select videotype.* from videotype where vth_id = #{vth_id}")
    List<VideoType> findVideoTypeByVthid(int vth_id);

    /**
     * 根据vtype_id查询出视频分类名
     * @param vtype_id
     * @return
     */
    @Select("select vtypename from videotype where id = #{vtype_id}")
    VideoType findVtypeNameByVtypeid(int vtype_id);

    /**
     * 根据typeheader查询出视频总分类名
     * @param vth_id
     * @return
     */
    @Select("select th.headername from videotype as vt inner join typeheader as th on (vt.vth_id = #{vth_id})")
    List<VideoType> findHeaderNameByVthid(int vth_id);
}
